package com.wing.order.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.order.model.entity.OrderDelivery;
import com.wing.order.model.response.OrderDeliveryDetailVO;
import com.wing.order.model.response.OrderDeliveryVO;
import com.wing.order.model.response.ScanDeliveryVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;
import java.util.Map;

/**
 * 配送-Dao
 *
 * @author
 */
@Mapper
public interface OrderDeliveryDao extends BaseMapper<OrderDelivery> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<OrderDeliveryVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<OrderDeliveryVO> list4app(@Param("page") Page<OrderDeliveryVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    OrderDeliveryVO get4appById(Long id);


    /**
     * 查看待上货列表
     */
    List<OrderDeliveryVO> stock(@Param("page") Page<OrderDeliveryVO> page, @Param("params") Map<String, Object> params);


    /**
     * 查看该批号 详情
     */
    List<OrderDeliveryDetailVO> stockInfo(@Param("deliveryOrderCode") String deliveryOrderCode);


    /**
     * 查看
     */
    List<OrderDeliveryVO> finshInfo(@Param("page") Page<OrderDeliveryVO> page, @Param("params") Map<String, Object> params);


    /**
     * 签收明细 产品信息
     */
    List<OrderDeliveryVO> signProduct(@Param("skuCode")String skuCode,@Param("deliveryOrderCode")String deliveryOrderCode);

    /**
     *签收信息列表
     */
    List<OrderDeliveryVO> infoSignList(@Param("page") Page<OrderDeliveryVO> page, @Param("params") Map<String, Object> params);

    /**
     * 签收信息详情
     * @param deliveryOrderCode
     * @return
     */
    List<OrderDeliveryVO> infoSign(@Param("deliveryOrderCode")String deliveryOrderCode);

    /**
     *领货列表 pickupDetail
     */
    List<OrderDeliveryVO> pickupList(@Param("page") Page<OrderDeliveryVO> page, @Param("params") Map<String, Object> params);

    /**
     * 領貨详情
     * @param deliveryOrderCode
     * @return
     */
    List<OrderDeliveryDetailVO> pickupDetail(@Param("deliveryOrderCode")String deliveryOrderCode);


    List<OrderDeliveryVO> admSign(@Param("deliveryOrderCode") String deliveryOrderCode);

    OrderDeliveryVO scanLable(@Param("packLabelCode") String packLabelCode,@Param("deliveryOrderCode") String deliveryOrderCode);

    int  isSignProduct(@Param("deliveryOrderCode") String deliveryOrderCode,@Param("skuCode")String skuCode);



    int getNum(@Param("deliveryOrderCode")String deliveryOrderCode);

    Integer countNotFinish(Long deliveryId);

    int getSum(@Param("deliveryOrderCode") String deliveryOrderCode,@Param("skuCode")String skuCode);
}
